package com.example.Service;

import com.example.pojo.Message;
import org.apache.ibatis.annotations.Param;
import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.data.jpa.repository.Query;

public interface MessageRepository extends JpaRepository<Message, Long> {

    @Query(value = "SELECT id, file, file_name, send_time, sender, recipient FROM message WHERE id = :id", nativeQuery = true)
    Message findFileById(@Param("id") Long id);

}
